
/**
 * The class PowOp extends the class BinaryOp and represents the Power operation
 * @author Michael Fildstein, ID: 309161594     
 * @author Tomer Ben Rachel ID: 021982475     
 */

public class PowOp extends BinaryOp{

	private String sign = "^";
	private double ans;
	private double precedence = 3;
  
 
 /**
 * The method operate receives two double data type parameters and returns the result of the Power of the first parameter by the second parameter
 * Meaning that we raise the first parameter (left) to the power of the second parameter (right)
 * @param left A double data type representing a number
 * @param right  A double data type representing a number
 * @return A double data type representing the Power of the first parameter by the second parameter
 */ 
 
	public double operate(double left, double right){
		this.ans = Math.pow(left, right);
		return ans;
		
	}
   
   
/**
 * The method toString returns a string representing the power sign
 * @return a string data type representing the power sign
 */     
	
	public String toString(){
		return sign;
	}
	
	public double getPrecedence() {
		return precedence;
	}
}

